package phoenix.mob_android.test_objects.data_providers;

import phoenix.core.PhoenixManager;
import phoenix.core.base.extensions.TestBaseExt;
import phoenix.core.data_models.TestUserDataModel;

/**
 * Class contains test data for Index page
 */
public class RegistrationDataProviders extends TestBaseExt
{
	public RegistrationDataProviders(PhoenixManager p_phoenix)
	{
		super(p_phoenix);
	}

	public Object[][] registrationDataSmokeMale()
	{
		TestUserDataModel tmpUser = new TestUserDataModel(manager);

		String email = "lissa@ag.net.ua";

		// Email - unique prefix
		String emailUniquePrefix = cronos().getCurrentDate("HHmmssyyMMdd") + randomizer().getRandomInt(1, 100).toString();
		String regEmailName = string().getSubstringBefore(email, "@");
		String regEmailDomain = string().getSubstringAfter(email, "@");

		// Email
		String regEmail = regEmailName + "+" + emailUniquePrefix + "@" + regEmailDomain;

		// Screen Name
		String regScreenname = regEmailName + "_" + emailUniquePrefix;
		// Password - length
		int passwordLength = 6;
		// Password
		String regPassword = randomizer().getRandomString(passwordLength);

		// Maximum allowed year
		String currentYear = cronos().getCurrentDate("yyyy");
		int lastAllowedYear = Integer.parseInt(currentYear) - 19;

		// Birth day
		String regBirthDay = randomizer().getRandomInt(10, 28).toString();
		String regBirthMonth = randomizer().getRandomInt(10, 12).toString();
		String regBirthYear = randomizer().getRandomInt(1970, lastAllowedYear).toString();
		String city = null;

		switch (manager.testModel().getLocation())
		{
			case "UK":
			{
				city = "London";
				break;
			}

			case "US":

			{
				city = "New York";
				break;
			}

			case "AUS":

			{
				city = "Brisbane";
				break;
			}

			default:
			{
				log().errorAndScreen("Incorrect location specifyed");
			}
		}

		String regUserId = "00000000000000000000000000000000";

		testUser()
				.setId(regUserId)
				.setEmail(regEmail)
				.setScreenname(regScreenname)
				.setPassword(regPassword)

				.setGender("male")
				.setSexuality("hetero");

		testUser()
				.setBirthDate(regBirthYear + "-" + regBirthMonth + "-" + regBirthDay)
				.setCountry(testModel().getLocation()).setCity(city)

				.setMembershipStatus(0)

				.setSiteName(testModel().getSiteName())
				.setUserKey(regUserId)

				.setRegSource("direct")

				.setRegDate(cronos().getCurrentDate("yyyy-MM-dd HH:mm:ss"))

				.setConfirmDate(cronos().getCurrentDate("yyyy-MM-dd HH:mm:ss"))
				.setHiddenStatus("0")

				.setPlatform(testModel().getPlatform());

		tmpUser = testUser();

		String correct_pass = "123456";
		String email_with_space = "qqq qqq qqq";
		String email_with_point = "qqq.qqq.qqq";
		String email_with_dog = "qqq@qqq qqq";
		String email_with_two_dog = "qqq@qqq@qqq";
		String email_with_dog_and_point = "qqq@qqq..qqq";
		String short_pass = "qwert";
		String long_pass = "25symbollongpasswordcheck";

		return new Object[][] {
				{ tmpUser, regEmail, correct_pass, email_with_space, email_with_point, email_with_dog, email_with_two_dog, email_with_dog_and_point,
						short_pass, long_pass }
		};
	}
}